package com.ziki.test.socket.thread;

import java.util.TimerTask;

public class MyTimerTask extends TimerTask {

	/**
	 * 1秒内的发送次数
	 */
	private static int currentSendCount = 0;

	public void run() {
		// 1秒清0一次
		System.out.println("Speed:" + currentSendCount);
		currentSendCount = 0;
	}

	/**
	 * 发送计数器加一
	 */
	public static void addCounter() {
		currentSendCount++;
	}

}
